/*
 * @(#)xin.tianhui.cloud.weblog.config
 * @(#)ThymeleafDialectConfiguration.java	2018-04-05
 * 
 * Copyright © 2018-2027, All rights reserved.
 * homeanter
 */
package xin.tianhui.cloud.weblog.config;

import java.util.Collection;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.processor.IProcessor;

import xin.tianhui.cloud.weblog.thymeleaf.dialect.AppDialect;
import xin.tianhui.cloud.weblog.thymeleaf.processor.ArticleProcessor;
import xin.tianhui.cloud.weblog.thymeleaf.processor.ChannelProcessor;
import xin.tianhui.cloud.weblog.thymeleaf.processor.DemoAttrProcessor;

/**
 * <P>Description: Thymeleaf 方言配置文件</P>
 * @ClassName: A
 * @author junchen homeanter@163.com  
 * @date 2018-04-05 19:53:33
 * @see TODO
 */
@Configuration
public class ThymeleafDialectConfiguration {
	
	@Bean
	public IProcessor attrProcessor() {
		return new DemoAttrProcessor(AppDialect.PREFIX);
	}
	
	@Bean
	public IProcessor articleProcessor() {
		return new ArticleProcessor(AppDialect.PREFIX);
	}
	
	@Bean
	public IProcessor channelProcessor() {
		return new ChannelProcessor(AppDialect.PREFIX);
	}
	
	@Bean
    public AppDialect appDialect(Collection<IProcessor> processors) {
        return new AppDialect(processors);
    }
}
